import React from 'react'
import './Send.less'
import { Spin} from 'antd'
import Title from './Title.jsx'

export default class Send extends React.Component {
    constructor() {
        super()
        this.state = {
            loading: true
        }
    }

    handleEmainChange(e) {
        console.log(e.target.value)
    }

    init() {
        setTimeout(() => {
            this.setState({
                loading: false
            })
        },3000)
    }

    componentDidMount() {
        this.init()
    }

    render() {
        const { loading } = this.state
        return (
            <div className="send">
                <div className="hiddenWrapper">
                    <div className="formContainer">
                        <form action="">
                            <input onChange={e => this.handleEmainChange(e)} className="emailInput" type="text" placeholder="YOUR EMAIL"/>
                            <Spin style={{display: loading?'block':'none'}}></Spin>
                        </form>
                    </div>
                </div>
                <div className="trigger">
                    <p>Email Me</p>
                </div>
                <Title></Title>
            </div>
        )
    }
}